﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.DataAccess;
using System.Data;
using University.Workshop.Model;

namespace University.Workshop.Business
{
    public static class PurchaseController
    {
        public static string GetPurchaseCode()
        {
            DataTable table = DataAccessPurchase.GetPurchaseCode();
            return (Convert.ToDouble(table.Rows[0].ItemArray[0].ToString(), System.Globalization.CultureInfo.CurrentCulture) + 1).ToString(System.Globalization.CultureInfo.CurrentCulture);
        }

        public static void PurchaseRegister(Purchase purchase)
        {
            DataAccessPurchase.PurchaseRegister(purchase);
        }

        public static void PurchaseDetailRegister(PurchaseDetail purchaseDetail)
        {
            DataAccessPurchase.PurchaseDetailRegister(purchaseDetail);
        }
    }
}
